package com.lwz.flyweight;

/**
 * 封装数据中重复出现的部分享元对象
 * @author liuwangzhen
 *
 */
public class AuthenticationFlyweight implements Flyweight {
	
	private String securityEntity;
	
	private String permit;
	
	public AuthenticationFlyweight(String key){
		String[] split = key.split(",");
		this.securityEntity = split[0];
		this.permit = split[1];
	}

	@Override
	public boolean match(String securityEntity, String permit) {
		if(this.securityEntity.equals(securityEntity)&&this.permit.equals(permit)){
			return true;
		}
		return false;
	}

}
